package com.mszlu.news.admin.controller;

import com.mszlu.news.admin.pojo.Admin;
import com.mszlu.news.admin.service.LoginService;
import com.mszlu.news.admin.vo.ResponseResult;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "登录")
@RestController
//@RequestMapping("admin")
public class LoginController {

    @Autowired
    private LoginService loginService;

    @PostMapping("/admin/login")
    public ResponseResult login(@RequestBody Admin admin){
        return loginService.login(admin);
    }


    @RequestMapping("/admin/logout")
    public ResponseResult logout(){
        return loginService.logout();
    }
}
